import React from 'react'
// ===================================================================== Temp
import SearchForm from '#cpt/temp/SearchForm'
import Table from '#cpt/temp/Table'
// ===================================================================== global declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const Page 					= $Lazy.load(()=>import('#tp/page/page-container'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		selectedKeys:[],
		// 搜索表单列表
		forms : [
			{ label: '时间', 			names: ['start_time','end_time'], type:'date-range' },
			{ label: '真实姓名',			name: 'user_real_name' },
			{ label: '用户编号',			name: 'user_number' },
			{ label: '登录IP',			name: 'login_ip' },
		]
	}
	
	model = {}
	
	componentDidMount(){
		this.fetch()
	}
	// paging
	fetch = () => $fn.fetch.call(this,'lis-login-log/index')
	
	// 表单
	cols = [
		{ title: '真实姓名',			dataIndex: 'user_real_name', 	...$fn.table.name },
		{ title: '用户编号', 		dataIndex: 'user_number', 		width:100 },
		{ title: '登录IP', 			dataIndex: 'login_ip', 			width:150 },
		{ title: '当前登录时间', 		dataIndex: 'login_time', 		...$fn.table.time },
		{ title: '上次登录时间', 		dataIndex: 'last_login_time', 	...$fn.table.time },
	]
	render(){
			return (
				<>
					<Page title='系统登录日志'>
						{/* 搜索 */}
						{ SearchForm.call(this) }
						{/* 表格 */}
						{ Table.call(this) }
					</Page>
				</>
			)
		}
	}

export default Index